home *** CD-ROM | disk | FTP | other *** search
- Path: news.mindspring.com!usenet
- From: efried@mindspring.com (Eric Friedman)
- Newsgroups: comp.lang.c,comp.programming
- Subject: Re: Assertive or Defensive?
- Date: Fri, 22 Mar 1996 08:15:40 GMT
- Organization: MindSpring Enterprises
- Message-ID: <4itcs2$po3@B1FF.mindspring.com>
- References: <4ioggn$3sf@dazzle.east-tenn-st.edu>
- NNTP-Posting-Host: efried.mindspring.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- zebl1@bobcat.east-tenn-st.edu (Eric B. Lemings) wrote:
-
- >For those readers who are familiar with the concept of defensive
- >programming, I for one would like to know under what conditions
- >should assertions be used and under what conditions should
- >defensive code be used? Both have somewhat similar intentions
- >but do not, I believe, have the same contexts.
-
- IMHO, assertions should be used during development to help detect
- situations not expected in "real-life", but that can be encountered
- during the initial coding effort. Detecting null pointers would be an
- example. Defensive coding should certainly be used to detect bad input
- from users.
-
- Use assertions to detect programming errors.
-
- e
- -------------------------------------------------------
- Eric Friedman Internet: efried@mindspring.com
-
-